package com.tenglong.teacher.ui.common.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.tenglong.teacher.R;
import com.tenglong.teacher.ui.tool.imagetouch.sephiroth.android.library.imagezoom.ImageViewTouch;


/**
 * Created by Kevin on 2018/1/28.
 */

public class ZoomPicAcitivity extends Activity {
    ImageView ziv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN , WindowManager.LayoutParams. FLAG_FULLSCREEN);
        setContentView(R.layout.activity_zoom_image);
        ziv =  findViewById(R.id.ziv);
        String uri=getIntent().getStringExtra("uri");
        int rotate=getIntent().getIntExtra("rotate",0);
       // ziv.setImageBitmap(ShareBitmap.getInstance().getBitmap());
        RequestOptions options = new RequestOptions()
                .fitCenter()
                .placeholder(com.netease.nim.uikit.R.drawable.nim_image_default)
                .error(com.netease.nim.uikit.R.drawable.nim_image_default);
        if(rotate==1){
            Glide.with(this).load(uri)
                   .apply(options)
                    .into(ziv);
        }else{
            Glide.with(this).load(uri)
                    .apply(options)
                    .into(ziv);

        }

        /*ziv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              // ZoomPicAcitivity.this.finish();
            }
        });*/
    }
}
